package com.notary.email;


import javax.mail.MessagingException;
import java.io.IOException;
import java.util.Map;


/**
 * Title: MailService
 * Description: JavaMailSender接口发送邮件
 */
public interface MailService {

    /**
     * 预览邮件内容
     *
     * @param params
     * @param templateName
     * @return
     * @throws Exception
     */
    String preview(Map<String, String> params, String templateName) throws Exception;

    /**
     * 发送文本邮件
     *
     * @param to
     * @param subject
     * @param content
     */
    void sendSimpleMail(String to, String subject, String content);

    void sendSimpleMail(String to, String subject, String content, String... cc);

    /**
     * 发送HTML邮件
     *
     * @param to
     * @param subject
     * @param templateName
     * @throws MessagingException
     */
    void sendHtmlMail(String subject, String to, Map<String, Object> params, String templateName) throws Exception;

    void sendHtmlMail(String subject, String to, Map<String, Object> params, String templateName, String... cc) throws Exception;

    /**
     * 发送带附件的邮件
     *
     * @param to
     * @param subject
     * @param templateName
     * @param filePath
     * @throws MessagingException
     */
    void sendAttachmentsMail(String subject, String to, Map<String, Object> params, String templateName, String filePath) throws Exception;

    void sendAttachmentsMail(String subject, String to, Map<String, Object> params, String templateName, String filePath, String... cc) throws Exception;

    /**
     * 发送正文中有静态资源的邮件
     *
     * @param to
     * @param subject
     * @param content
     * @param rscPath
     * @param rscId
     * @throws MessagingException
     */
    void sendResourceMail(String to, String subject, String content, String rscPath, String rscId) throws MessagingException;

    void sendResourceMail(String to, String subject, String content, String rscPath, String rscId, String... cc) throws MessagingException;


}
